feat: Enables exclusive IAM policy management of IAM role with managed_policy_arns option #526
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR supports exclusive management of policy attachments on IAM role.
For prevent resource cycling error,
managed_policy_arns
can't be used with these resources :aws_iam_role_policy_attachment
oraws_iam_role_policy
.Motivation and Context
When using
aws_iam_role
and this module with themoved
command for refactoring (i mean refactor my resource with this module),although my
aws_iam_role
already containsmanaged_policy_arns
,the
managed_policy_arns
could not be set, so the dependency between IAM role and IAM policy could not be left as code, soaws_iam_role_policy_attachment
had to be added as resource.To prevent unexpected IAM policy changes, i thought adding
managed_policy_arns
option to IAM role can be clear choice for exclusive management of IAM role's policy.Breaking Changes
How Has This Been Tested?
examples/*
to demonstrate and validate my change(s)examples/*
projectspre-commit run -a
on my pull request